// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './components/vuex/store' // 应用vuex
import axios from "axios";

import {
    Picker
} from 'mint-ui';
import {
    MessageBox
} from 'mint-ui';

import {
    Indicator
} from 'mint-ui';

import {
    Toast
} from 'mint-ui';

import Promise from 'promise-polyfill';
if (!window.Promise) {
    window.Promise = Promise;
}
Vue.component(Picker.name, Picker);
Vue.config.productionTip = false
Vue.prototype.$http = axios;
Vue.prototype.$MessageBox = MessageBox;
Vue.prototype.$Indicator = Indicator;
Vue.prototype.$Toast = Toast;

router.beforeEach((to, from, next) => {
    if (to.meta.title) {
        document.title = to.meta.title
    }
    next()
})
new Vue({
    el: '#app',
    router,
    components: {
        App
    },
    store,
    template: '<App/>'
})